﻿using System;
using System.Windows;

namespace FrameWork.Core.Handler
{
    /// <summary>
    /// 自定义事件处理器
    /// </summary>
    public class RepowerEventTrigger : Microsoft.Xaml.Behaviors.EventTrigger
    {
        protected override void OnEvent(System.EventArgs eventArgs)
        {
            var routedEventArgs = eventArgs as System.Windows.RoutedEventArgs;
            if (routedEventArgs != null
                && (routedEventArgs.RoutedEvent.Name == "MouseRightButtonUp"
                || routedEventArgs.RoutedEvent.Name == "MouseLeftButtonUp"))
                routedEventArgs.Handled = true;
            else
                routedEventArgs.Handled = false;
            base.OnEvent(eventArgs);
        }
    }
}